package com.celesea.workflow.collaboration.entity;

import com.celesea.framework.util.DictionaryVoUtil;
import com.celesea.framework.util.Version;
import com.celesea.workflow.collaboration.v1.controller.request.PostRequest;
import com.celesea.workflow.core.entity.Workflow;

import javax.persistence.Column;
import javax.persistence.Table;

/**
 * @author JackYuan
 * @create 2017-11-18 15:22
 */

@Version
@Table(name = "wf_collaboration")
public class Collaboration extends Workflow {

    @Column(name = "`collaboration_dept_id`", columnDefinition = "协作部门Id", nullable = false)
    protected String collaborationDeptId;
    @Column(name = "`collaboration_dept_name`", columnDefinition = "协作部门名称", nullable = false)
    protected String collaborationDeptName;

    @Column(name = "`task_name`", columnDefinition = "任务名称", nullable = false)
    protected String taskName;

    @Column(name = "`task_content`", columnDefinition = "任务内容", nullable = false)
    protected String taskContent;

    @Column(name = "`users`", columnDefinition = "处理人")
    private String users;



    public Collaboration() {
    }

    public Collaboration(PostRequest request) {
        super();
        super.applyInfo();
        this.collaborationDeptId = request.getCollaborationDept().getId();
        this.collaborationDeptName = request.getCollaborationDept().getName();
        this.taskName = request.getTaskName();
        this.taskContent = request.getTaskContent();
        this.users= DictionaryVoUtil.toJson(request.getUsers());
    }


    public String getCollaborationDeptId() {
        return collaborationDeptId;
    }

    public void setCollaborationDeptId(String collaborationDeptId) {
        this.collaborationDeptId = collaborationDeptId;
    }

    public String getCollaborationDeptName() {
        return collaborationDeptName;
    }

    public void setCollaborationDeptName(String collaborationDeptName) {
        this.collaborationDeptName = collaborationDeptName;
    }

    public String getTaskName() {
        return taskName;
    }

    public void setTaskName(String taskName) {
        this.taskName = taskName;
    }

    public String getTaskContent() {
        return taskContent;
    }

    public void setTaskContent(String taskContent) {
        this.taskContent = taskContent;
    }

    public String getUsers() {
        return users;
    }

    public void setUsers(String users) {
        this.users = users;
    }
}
